/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.settlement.entity.carpresettlement;

import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.modules.base.entity.cars.Tcar;
import com.jeesite.modules.base.entity.fixedexpense.FixedExpense;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.bpm.entity.BpmEntity;

/**
 * 车辆预结算单Entity
 * @author shengbin
 * @version 2021-04-07
 */
@Table(name="t_car_presettlement_detail", alias="a", columns={
		@Column(name="car_presettlement_detail_id", attrName="carPresettlementDetailId", label="车辆预结算子表编号", isPK=true),
		@Column(name="car_presettlement_id", attrName="carPresettlementId.carPresettlementId", label="车辆预结算编号"),
		@Column(name="frame_number", attrName="frameNumber", label="车架号"),
		@Column(name="car_name", attrName="carName", label="车辆名称", queryType=QueryType.LIKE),
		@Column(name="car_price", attrName="carPrice", label="车价", comment="车价（外币）"),
		@Column(name="currency", attrName="currency", label="币种"),
		@Column(name="charge_type", attrName="chargeType", label="类型"),
		@Column(name="presettlement_amount", attrName="presettlementAmount", label="预结算金额", comment="预结算金额（RMB）"),
		@Column(name="presettlement_advances_received_amount", attrName="presettlementAdvancesReceivedAmount", label="预结算预收余额"),
		@Column(name="balance", attrName="balance", label="差额"),
		@Column(name="type", attrName="type", label="1客户2资方"),
	},joinTable={
		@JoinTable(type= JoinTable.Type.LEFT_JOIN, entity= FixedExpense.class, attrName="fixedExpense", alias="b",
				on="b.fixed_expense_id = a.charge_type", columns={
				@Column(name="fixed_expense_id", label="类型id", isPK=true),
				@Column(name="fixed_expense_name", label="类型名称", isQuery=false),
		}),
},orderBy="a.car_presettlement_detail_id ASC"
)
public class TcarPresettlementDetail extends DataEntity<TcarPresettlementDetail> {
	
	private static final long serialVersionUID = 1L;
	private String carPresettlementDetailId;		// 车辆预结算子表编号
	private TcarPresettlement carPresettlementId;		// 车辆预结算编号 父类
	private String frameNumber;		// 车架号
	private String carName;		// 车辆名称
	private Double carPrice;		// 车价（外币）
	private String currency;		// 币种
	private String chargeType;		// 类型
	private Double presettlementAmount;		// 预结算金额（RMB）
	private Double presettlementAdvancesReceivedAmount;		// 预结算预收余额
	private Double balance;		// 差额
	private Long type;		// 1客户2资方

	public FixedExpense getFixedExpense() {
		return fixedExpense;
	}

	public void setFixedExpense(FixedExpense fixedExpense) {
		this.fixedExpense = fixedExpense;
	}

	private FixedExpense fixedExpense;//固定费用类型

	public String getChargeTypeName() {
		return chargeTypeName;
	}

	public void setChargeTypeName(String chargeTypeName) {
		this.chargeTypeName = chargeTypeName;
	}

	private String chargeTypeName;		// 类型名称
	
	public TcarPresettlementDetail() {
		this(null);
	}


	public TcarPresettlementDetail(TcarPresettlement carPresettlementId){
		this.carPresettlementId = carPresettlementId;
	}
	
	public String getCarPresettlementDetailId() {
		return carPresettlementDetailId;
	}

	public void setCarPresettlementDetailId(String carPresettlementDetailId) {
		this.carPresettlementDetailId = carPresettlementDetailId;
	}
	
	public TcarPresettlement getCarPresettlementId() {
		return carPresettlementId;
	}

	public void setCarPresettlementId(TcarPresettlement carPresettlementId) {
		this.carPresettlementId = carPresettlementId;
	}
	
	@Length(min=0, max=100, message="车架号长度不能超过 100 个字符")
	public String getFrameNumber() {
		return frameNumber;
	}

	public void setFrameNumber(String frameNumber) {
		this.frameNumber = frameNumber;
	}
	
	@Length(min=0, max=100, message="车辆名称长度不能超过 100 个字符")
	public String getCarName() {
		return carName;
	}

	public void setCarName(String carName) {
		this.carName = carName;
	}
	
	public Double getCarPrice() {
		return carPrice;
	}

	public void setCarPrice(Double carPrice) {
		this.carPrice = carPrice;
	}
	
	@Length(min=0, max=2, message="币种长度不能超过 2 个字符")
	public String getCurrency() {
		return currency;
	}

	public void setCurrency(String currency) {
		this.currency = currency;
	}
	
	@Length(min=0, max=2, message="类型长度不能超过 2 个字符")
	public String getChargeType() {
		return chargeType;
	}

	public void setChargeType(String chargeType) {
		this.chargeType = chargeType;
	}
	
	public Double getPresettlementAmount() {
		return presettlementAmount;
	}

	public void setPresettlementAmount(Double presettlementAmount) {
		this.presettlementAmount = presettlementAmount;
	}
	
	public Double getPresettlementAdvancesReceivedAmount() {
		return presettlementAdvancesReceivedAmount;
	}

	public void setPresettlementAdvancesReceivedAmount(Double presettlementAdvancesReceivedAmount) {
		this.presettlementAdvancesReceivedAmount = presettlementAdvancesReceivedAmount;
	}
	
	public Double getBalance() {
		return balance;
	}

	public void setBalance(Double balance) {
		this.balance = balance;
	}
	
	public Long getType() {
		return type;
	}

	public void setType(Long type) {
		this.type = type;
	}
	
}